#!/user/bin/python
#encoding:utf-8
import urllib,urllib2,requests,re
from bs4 import BeautifulSoup
url='http://cc.58.com/ershoufang/?PGTID=0d100000-0013-f6ab-84d8-941871644c63&ClickID=1'
def get_html(url):
    headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36'}
    request=urllib2.Request(url,headers=headers)
    response=urllib2.urlopen(request)
    text=response.read()
    # print text

    soup=BeautifulSoup(text,'html.parser')
    house_image=soup.find_all('img')
    for image in house_image:
        link=image.get('data-src')
        print link

    # soup=BeautifulSoup(text,'html.parser')
    # house_title=soup.find_all('h2')
    # for title in house_title:
    #     link1=title.find_all('a').get('href')
    #     print link1


get_html(url)
# def get_title(text):
#     text=get_html(url)
#     reg=re.compile('r<a href=".*?" target="_blank">(.*?) </a>')
#     item=re.findall(reg,text)
#     print item
#     # for t in item:
#     #     print t
